<?php namespace Common\Model;
use Hdphp\Model\Model;
class Type extends Model
{
	public $table = "type";
	public $validate = array(
	array("type_name","required","类型不能为空",3,3),
	);
	public function store()
	{
		if(!$this->create()) return FALSE;
		$type_name = explode("|", $_POST['type_name']);
		foreach ($type_name as $v) {
			$this->add(array("type_name"=>$v));
		}
		return TRUE;
	}
	public function edit()
	{
		
		if(!$this->create()) return false;
		
		return $this->save();
		
	}
	
}
